/**
 * 字符串工具类
 */
package indi.zjh.dp.util;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class StringUtil {
	/**
	 * 转换指定的类型到字符串
	 * @param input
	 * @return
	 */
	public static String getString(List<Map<String, Object>> input)
	{
		StringBuffer sb = new StringBuffer();
		
		Iterator<Map<String, Object>> iter = input.iterator();
		
		while(iter.hasNext())
		{
			Map<String, Object> record = iter.next();
			Iterator<Map.Entry<String, Object>> niter = record.entrySet().iterator();
			int size = record.entrySet().size();
			String[] strs = new String[size];
			int i = 0;
			while(niter.hasNext())
			{
				Map.Entry<String, Object> v = niter.next();
				strs[i++] = v.getKey() + " = " + v.getValue();
			}
			sb.append(String.join(", ", strs) + "\n");
		}
		
		return sb.toString();
	}
	
	
}
